package exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("1");
        try {
            String line = "abc";
            System.out.println(Integer.parseInt(line));
            // String line1="";
            //System.out.println(line1.charAt(0));

        } catch (StringIndexOutOfBoundsException  | NullPointerException e ){
            System.out.println("出现空指针或字符下标越界异常并解决");
//        }catch (NullPointerException p){
//            System.out.println("出现了空指针异常解决了");
        }catch (Exception e){
            System.out.println("反正就是错了，错哪不知道");
        }

            System.out.println("2");
        }
    }

